<template>
  <div>
    <div class="sub_title"><i>{{title}}</i></div>
    <div class="sub_header">
      <div class="block"
           v-for="(item,index) in picList"
           :key="index">
        <el-image class="img"
                  :src="item"
                  :preview-src-list="picList"
                  lazy
                  fit="cover">
        </el-image>
      </div>
    </div>
    <router-view />
  </div>
</template>

<script>
import photoModel from '../../utils/photoModel'
export default {
  name: 'index',
  props: {
    msg: String
  },
  computed: {},
  data() {
    return {
      photoModel: photoModel[2],
      picList: [],
      title: '标题'
    }
  },
  created() {},
  activated() {
    let itemId = this.$route.query.id
    this.photoModel.forEach(item => {
      if (item.id === itemId) {
        this.picList = item.list
        this.title = item.title
      }
    })
  },
  methods: {}
}
</script>
<style lang="less" scope>
.sub_header {
  display: flex;
  flex-wrap: wrap;
  .block {
    margin: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 0;
    padding-bottom: 366px;
    .img {
      width: 550px;
      height: 366px;
    }
  }
}
.sub_title {
  color: #e9967a;
  font-size: 25px;
  text-align: center;
  margin-bottom: 10px;
}
</style>
